﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Aga.Controls.Tree;

namespace UnrealDebugger.Panels
{
    public partial class DebuggerEventsPanel : Panel
    {
        public class EventNode : Node
        {
            private string _event = "";
            private string _time = "";

            public string Event { get { return _event; } }
            public string Time { get { return _time; } }

            public EventNode()
                : base()
            {
            }

            public EventNode(string text)
                : base(text)
            {
                _event = text;
                _time = DateTime.Now.ToString("[h:mm:ss]");
            }
        }

        private TreeModel _model = new TreeModel();

        public DebuggerEventsPanel()
        {
            InitializeComponent();
            this.treeViewDebuggerEvents.Model = _model;
        }

        #region Debugger Interface

        public void AddAction(string entry)
        {
            this.treeViewDebuggerEvents.BeginUpdate();

            EventNode node = new EventNode(entry);
            this._model.Nodes.Add(node);

            this.treeViewDebuggerEvents.EndUpdate();
        }

        #endregion
    }
}
